﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BankSystemWithCSharp
{
    public struct TransformRecord
    {
        public readonly string ID;
        public readonly DateTime Time;
        public readonly string MoneyFrom;
        public readonly string MoneyTo;
        public readonly double Money;
        public Object this[TransformRecordArbiName index]
        {
            get
            {
                switch (index)
                {
                    case TransformRecordArbiName.ID: return this.ID;
                    case TransformRecordArbiName.Time: return this.Time;
                    case TransformRecordArbiName.MoneyFrom: return this.MoneyFrom;
                    case TransformRecordArbiName.MoneyTo: return this.MoneyTo;
                    case TransformRecordArbiName.Money: return this.Money;
                    default: return this.ID;
                }
            }
        }
        public TransformRecord(string id, DateTime time, string moneyFrom, string moneyTo, double money)
        {
            ID = id;
            Time = time;
            MoneyFrom = moneyFrom;
            MoneyTo = moneyTo;
            Money = money;
        }
        public override string ToString()
        {
            return string.Format("{0}, {1}, {2}, {3}, {4}", ID, Time, MoneyFrom, MoneyTo, Money.ToString("0.00"));
        }
    }
}